"""
矩阵转置
"""
list1 = list(map(int, input().split()))
for i in range(0, len(list1) , 3):
    print("{:4d}".format(list1[i]), end='')
print()
for i in range(1, len(list1) , 3):
    print("{:4d}".format(list1[i]), end='')
print()
for i in range(2, len(list1) , 3):
    print("{:4d}".format(list1[i]), end='')
